import Vue from 'vue'
import Meta from 'vue-meta'
import Router from 'vue-router'
// webpack支持lazy load 加载js模块 ，但在开发环境我们没有必要开启
const _import = require('./_import_' + process.env.NODE_ENV)

Vue.use(Router)
Vue.use(Meta)

export default new Router({
  routes: [
    {
      path: '/',
      name: 'home',
      meta: {
        keepAlive: true
      },
      component: _import('home/index')
    },
    {
      path: '/order', // 订单详情
      name: 'order',
      meta: {
        keepAlive: false
      },
      component: _import('order/index')
    },
    {
      path: '/record', // 往来记录
      name: 'record',
      meta: {
        keepAlive: false
      },
      component: _import('record/index')
    },
    {
      path: '/login',
      name: 'login',
      meta: {
        keepAlive: false
      },
      component: _import('login/index')
    }
  ]
})
